package cn.slt.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;


public class String2Date {
	
	public  Date  string2date(String time){
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 
		Date date=null;       //util date
		Date date2=null;      //sql date
		try {
			 date=sdf.parse(time);
			 
			 date2=new java.sql.Date(date.getTime());
			
		} catch (ParseException e) {
			e.printStackTrace();
			
		}
		
		return date2;
	}
	
}
